import { ResPage } from '@/api/interface'
import { ChangeTrend } from './interface'
import { TBY } from '@/api/config/servicePort'
import http from '@/api'

export const pageChangeTrend = (params: ChangeTrend.Query) => {
  return http.get<ResPage<ChangeTrend.Record>>(TBY + `/change_trend/page`, params)
}

// 详情
export const getChangeTrendDetail = (id: number) => {
  return http.get<Partial<ChangeTrend.Form>>(TBY + `/change_trend/get`, { id }, { loading: false })
}

// 新增或修改
export const saveOrUpdateChangeTrend = (params: Partial<ChangeTrend.Form>) => {
  return http.post(TBY + `/change_trend/save_or_update`, params)
}

// 删除
export const removeChangeTrend = (id: number) => {
  return http.delete(TBY + `/change_trend/delete`, { id })
}

// 列表
export const listChangeTrend = (params: ChangeTrend.Query) => {
  return http.get<ChangeTrend.Record[]>(TBY + `/change_trend/list`, params)
}
